added invalid response, changed already exists status code to a more exact one, added tests