Added basic auth around the PUT and POST for the api endpoint

- Checks for "robocopAuth" cookie when trying to write to the db
- CORS headers now echos back the origin so that cookies can be sent via JavaScript
Merge pull request #5 from K4orta/endpoint-auth

Endpoint auth