Cleaned up code, added return statements after some response function calls