Rename lib.api to lib.endpoint
Add standard JSON stuff to api
Merge pull request #43 from mdmoss/master

Standardise JSON responses and fix imports
Convert Event Views to use json api
Convert Group Views to use json api