Refactored all API endpoints to be RESTful

No more ugly php file endpoints. Front end application has not yet been
updated for these changes (breaks front end behavior).