Added basic exception handling and post request handling