Sql -> SQL
Split box check out of check_api_key into its own check
function.