An assignment using rails api and angularJs