API - Basic API calls

This function should be smart enough to add WHERE clause is needed. (I guess add an extra argument. By default it is false but if it is specified as true then the string will start with WHERE ... )