Fixed several issues, and created a generic response structure.