Fixed class extension and name
Fixed catch block to return the correct code and message