Make the CreateFromQuery function return an array of results or one result if explicitly defined
Add a function for returning HTTP status code headers