putting in some error catching
throwing api error to client
v 1.1.2
adding some logging