changed responses to be json responses, some minor changes to urls as well