Fixes on the API to work with AngularJS

This changes were made in order for Kilink to work with https://github.com/aseba/LinkkodeFE. 

Most of the changes are CORS fixes.