Error-handling cleanup of rest.go.
Error-handling cleanup of rest.go.

ceejatec/sync_gateway,couchbaselabs/sync_gateway,tophatch/sync_gateway,paulharter/sync_gateway,paulharter/sync_gateway,evankyle/sync_gateway,couchbaselabs/sync_gateway,tleyden/sync_gateway,ceejatec/sync_gateway,paulharter/sync_gateway,paulharter/sync_gateway,couchbaselabs/sync_gateway,evankyle/sync_gateway,tleyden/sync_gateway,evankyle/sync_gateway,tleyden/sync_gateway,jamiltz/sync_gateway,jamiltz/sync_gateway,tophatch/sync_gateway,tophatch/sync_gateway,ceejatec/sync_gateway,jamiltz/sync_gateway,ceejatec/sync_gateway,couchbaselabs/sync_gateway,evankyle/sync_gateway,tophatch/sync_gateway,tleyden/sync_gateway