creating routes in backend for using $resource in service for retrieving data in frontend