Rest API - authentication via ajax, and some other actions