updated src to use common error response for all three APIs