Instead of returning tokens, statements and errors, return a status code (perhaps make an enum for this). Then the client can make a decision based on the status code on what to query from the respective structs: errors or the result data (tokens, statements)