modify controller so that it returns json objects for requests from mobile devices