Cleans up code + presents more API-like interface

Switch to using JSON results
Rename indexAction to loginAction
Update route to be /login