fixes some error handling in api, now returns 503 instead of 500 if DB is unreachable
fixes some error handling in api, now returns 503 instead of 500 if DB is unreachable

hkjn/junk,hkjn/junk,hkjn/junk,hkjn/junk,hkjn/junk