Log API errors in Rails log

Currently the exception message is returned in the JSON error response, but the backtrace is lost.

This patch adds logging of the exception's message & backtrace to the rails log