Error handling on POST request