moved auth to service and fixed api tests