Improved status codes.

Added 201 for successful POSTs.
Returning status codes for failing scenarios.