Fix so that /api/ follows the specified api documentation.
Fix so that /api/signup/ follow the specified api documentation.
Fix so that /api/login/ follow the specified api documentation.
Fix so that /api/logout/ follow the specified api documentation.
Add missing csrf parameter and use it instead of looking it up in the session
Add correct return format for require_authentication and require_csrf_token