migrate to $resource
authentication and bind to backend