removed unused global variable from api controller
added urlFactory to generate urls for api endpoints
updated api responses to include urls for related data for REST compliance