Split error handling from the main class, deprecated query_as_array and query_as_object