move static extraction functions from handler to separate file.
send out json parse message instead of generic error message.
s/logger/log