API - Basic API calls

The whole get function could be refactored. Most of the gets look alike. It is generate_log, check token permissions, execute some queryDB and get result, return result. The only things which change is permission, query and query arguments. think about it