added JSON responses and moved all JSON stuff into a category
updated comments