API - Basic API calls

Add extra argument $queryIDExistence. Idea that the passed query will check number of rows returned by the query execution and it will return 404 (if 0 and request is GET or PUT or DELETE)