functions now can receive the query directly and return the string, json return only in the script or added at end of functions
adds ;