fixed error message and added ajax route