cleaned up horrible server code and made API site a little better